{% extends 'base.html' %}

{% block top_content %}
    <div class="gcb-cols">
      <div class="gcb-col-11 gcb-aside">

        {% include 'summary.html' %}

      </div>
    </div>
{% endblock %}

{% block main_content %}
    <div style="margin-top: 20px;" class="gcb-cols">
      <div class="gcb-col-1">
      </div>
      <div class="gcb-col-9">

        <h1 class="schedule-headers">
          {% trans %} Schedule {% endtrans %}
        </h1>
        <div class="gcb-main">
          <div style="width: 100%;" class="gcb-nav" id="gcb-nav-y">
            <ul>
              {% for unit in units %}
                {% if unit.now_available or is_course_admin %}
                  {% if unit.type == 'A' %}
                    <li><p class="top_content">
                      {% if progress[unit.unit_id] > 0 %}
                        <img src="assets/lib/completed.png"
                             alt="{% trans %} Completed {% endtrans %}"
                             title="{% trans %} Completed {% endtrans %}"
                             class="progress"
                             id="progress-completed-{{unit.unit_id}}">
                      {% else %}
                        <img src="assets/lib/not_started.png"
                             alt="{% trans %} Not yet submitted {% endtrans %}"
                             title="{% trans %} Not yet submitted {% endtrans %}"
                             class="progress"
                             id="progress-notstarted-{{unit.unit_id}}">
                      {% endif %}
                      <a href="assessment?name={{ unit.unit_id }}">{{ unit.title }}</a>
                  {% elif unit.type == 'U' %}
                    <li><p class="top_content">
                      {% if is_progress_recorded %}
                        {% if progress[unit.unit_id] == 2 %}
                          <img src="assets/lib/completed.png"
                               alt="{% trans %} Completed {% endtrans %}"
                               title="{% trans %} Completed {% endtrans %}"
                               class="progress"
                               id="progress-completed-{{unit.unit_id}}">
                        {% elif progress[unit.unit_id] == 1 %}
                          <img src="assets/lib/in_progress.png"
                               alt="{% trans %} In progress {% endtrans %}"
                               title="{% trans %} In progress {% endtrans %}"
                               class="progress"
                               id="progress-inprogress-{{unit.unit_id}}">
                        {% else %}
                          <img src="assets/lib/not_started.png"
                               alt="{% trans %} Not yet started {% endtrans %}"
                               title="{% trans %} Not yet started {% endtrans %}"
                               class="progress"
                               id="progress-notstarted-{{unit.unit_id}}">
                        {% endif %}
                      {% else %}
                        <span class="progress-empty"></span>
                      {% endif %}

                      <a href="unit?unit={{ unit.unit_id }}">
                        {{ gettext('Unit %(id)s - %(title)s', id=unit.index, title=unit.title) }}
                      </a>
                  {% elif unit.type == 'O' %}
                    <li>
                      <p class="top_content">
                        <span class="progress-empty"></span>
                        <a href="{{ unit.href }}"> {{ unit.title }} </a>
                  {% else %}
                    <li>
                      <p class="top_content">
                        <span class="progress-empty"></span>
                        Error: unit type not recognized.
                  {% endif %}
                      {% if not unit.now_available and is_course_admin %}
                        (Private)
                      {% endif %}
                      </p>
                    </li>
                {% else %}
                  {% if unit.type == 'A' %}
                    <li>
                      <p class="top_content">
                        <span class="progress-empty"></span>
                        {{ unit.title }}
                      </p>
                    </li>
                {% elif unit.type == 'U' %}
                    <li>
                      <p class="top_content">
                        <span class="progress-empty"></span>
                        {{ gettext('Unit %(id)s - %(title)s', id=unit.index, title=unit.title) }}
                        <span style="padding-left: 20px; font-size: 12px; color: #5e94ff;">
                          {{ unit.release_date }}
                        </span>
                      </p>
                    </li>
                  {% elif unit.type == 'O' %}
                    <li>
                      <p class="top_content">
                        <span class="progress-empty"></span>
                        {{ unit.title }}
                      </p>
                    </li>
                  {% else %}
                    <li>
                      <p class="top_content">
                        <span class="progress-empty"></span>
                        Error: unit type not recognized.
                      </p>
                    </li>
                  {% endif %}
                {% endif %}

              {% endfor %}
            </ul>
          </div>
        </div>

      </div>
    </div>
{% endblock %}
